/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-1-10 上午11:58 Created by lyyang
 */
package com.jade.bss.business.groupon;

import java.util.List;
import javax.ejb.TransactionAttribute;

import com.jade.bss.base.BssException;
import com.jade.framework.base.criterion.Criteria;
import com.jade.framework.base.util.PagingList;
import org.springframework.transaction.annotation.Transactional;

/**
 * 团购券管理器
 *
 * @author <a href="mailto:lyyang@ceno.cn">lyyang</a>
 * @version 1.0 15-1-10 上午11:58
 */
public interface GrouponManager
{
    PagingList<SnifferSetting> querySetting(Criteria criteria);

    long getSnifferInterval();

    void setSnifferInterval(long snifferInterval);

    @TransactionAttribute
    @Transactional (rollbackFor = Throwable.class)
    List<Groupon> sniffer(String ownerId, String ownerType)
            throws BssException;

    @TransactionAttribute
    @Transactional (rollbackFor = Throwable.class)
    List<Groupon> sniffer(String ownerId, String ownerType, String city, String channel, String keyword)
            throws BssException;

    List<Groupon> listGroupon(String ownerId, String ownerType, Criteria criteria)
            throws BssException;

    PagingList<Groupon> queryGroupon(String ownerId, String ownerType, Criteria criteria);

    void addSetting(SnifferSetting setting);

    void updateSetting(SnifferSetting setting);

    void removeSetting(long... ids);

    void removeSetting(String ownerId, String ownerType);

    SnifferSetting getSetting(String ownerId, String ownerType, String channel);

    List<SnifferSetting> listSetting(String ownerId, String ownerType);

    List<SnifferSetting> listSetting(Criteria criteria);

    SnifferSetting getSetting(long id);

    Groupon get(long id);

    @TransactionAttribute
    @Transactional (rollbackFor = Throwable.class)
    List<Groupon> sniffer()
            throws BssException;
}
